<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<%@ page import="org.springframework.web.context.support.*" %>
<%@ page import="org.springframework.context.*" %>
<html>
<body bgcolor="#EEEEEE">
<div align="center" style="">
<table>
<%
	ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());

	org.apache.commons.dbcp.BasicDataSource dataSource = (org.apache.commons.dbcp.BasicDataSource )context.getBean("dataSource");

	out.println("<tr><td>MaxActive(最大连接数):</td>");
	out.println("<td>"+dataSource.getMaxActive()+"</td></tr>");

	out.println("<tr><td>MaxIdle(最大空闲连接):</td>");
	out.println("<td>"+dataSource.getMaxIdle()+"</td></tr>");

	out.println("<tr><td>NumActive(当前连接数):</td>");
	out.println("<td>"+dataSource.getNumActive()+"</td></tr>");

	out.println("<tr><td>NumIdle(空闲数):</td>");
	out.println("<td>"+dataSource.getNumIdle()+"</td></tr>");
	
	out.println("<tr><td>InitialSize(连接池初始化大小):</td>");
	out.println("<td>"+dataSource.getInitialSize()+"</td></tr>");
	
	out.println("<tr><td>Statements(最高打开500个Statement):</td>");
	out.println("<td>"+dataSource.getMaxOpenPreparedStatements()+"</td></tr>");
	
	out.println("<tr><td>超时回收时间(以毫秒为单位):</td>");
	out.println("<td>"+dataSource.getMaxWait()+"</td></tr>");
	
	
%>
</table></div>
</body>
</html>